import _ from 'lodash'
let settings = {
    auth: {
        TOKEN: 'token',
        REFRESH_TOKEN: 'refresh_token',
        UUID: 'uuid',
        EXPIRES_IN: 'expires_in',
        INTERVAL_TIME_MS: 120000, // 毫秒
        LOGIN_ROUTE_NAME: 'Login',
        WHITE_LIST: [], // 访问控制-白名单
    },
    oauth2: {
        endpoints: {
            TOKEN_ENDPOINT: '/oauth/token',
        },
        client: {
            client_id: 'client_id',
            client_secret: 'client_secret',
        },
    },
}

/**
 * 定义配置信息
 * @param {Object} config 配置信息
 */
export function defineConfig(config) {
    settings = _.merge({}, settings, config)
}

export function getConfig() {
    return settings
}

export default getConfig()
